﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Chitiettintuc : System.Web.UI.Page
{
    BUS_News objN = new BUS_News();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            hienthi();
        }
    }
    public void hienthi()
    {
        if (Request.QueryString.Get("id") != null)
        {
            int id = int.Parse(Request.QueryString.Get("id"));
            var dtN = objN.BUS_News_getDataById(id);
            if (dtN.Rows.Count > 0)
            {
                lvchitiettt.DataSource = dtN;
                lvchitiettt.DataBind();
            }
        }
        else {
            if (Request.QueryString.Get("type") != null)
            {
                int type = int.Parse(Request.QueryString.Get("type"));
                var dtN = objN.BUS_News_getDataByType(type);
                if (dtN.Rows.Count > 0)
                {
                    lvchitiettt.DataSource = dtN;
                    lvchitiettt.DataBind();
                }
            }
        }
    }
}